package vn.sunnet.backviet01.game.coloa.util.mypool;

import org.anddev.andengine.opengl.texture.region.TextureRegion;
import org.anddev.andengine.util.pool.GenericPool;

import vn.sunnet.backviet01.game.coloa.human.enemy.DoThuMagic;

public class DoThuMagicPool extends GenericPool<DoThuMagic>{
	private final TextureRegion mTextureRegion;
	
	public DoThuMagicPool(TextureRegion pTextureRegion) {
		this.mTextureRegion = pTextureRegion;
	}
	
	@Override
	protected DoThuMagic onAllocatePoolItem() {
		// TODO Auto-generated method stub
		return new DoThuMagic(0, 0, mTextureRegion.deepCopy());
	}
	
	protected void onHandleRecycleItem(final DoThuMagic circle) {
		circle.setIgnoreUpdate(true);
		circle.clearEntityModifiers();
		circle.clearUpdateHandlers();
		circle.setVisible(false);
		circle.detachSelf();
		circle.reset();
	}
}
